<template>
    <form>
        <NameInput v-model="username"/>
        <PasswordInput v-model="password"/>
        <ButtonInput :btntext="text" @registermethod="$emit('click',username,password)"
            :disabled='isDisabledButton'/>
        </form>
</template>

<script>
import  NameInput from './NameInput';
import PasswordInput from './PasswordInput'
import ButtonInput from './ButtonInput'
export default {
    name:'CardForm',
    components:{
        NameInput,
        PasswordInput,
        ButtonInput
    },
     props: {
        text: {
            default: '提交'
        }
       
        },
    data: function () {
        return {
            username: '',
            password: ''
        }
            },
            computed: {
                isDisabledButton: function () {
                    return this.username.length == 0 || this.password.length == 0;
                }
            },
}
</script>